package cz.muni.fi.pa165.mushroom.website.dao;


import cz.muni.fi.pa165.mushroom.website.entities.Mushroom;
import cz.muni.fi.pa165.mushroom.website.entities.MushroomType;

import java.util.List;

/**
 * DAO interface for Mushroom entity.
 * 
 * @author Veronika Lovrantova
 */
public interface MushroomDao {
    /**
     * Method that adds Mushroom object into database.
     * 
     * @param mushroom Mushroom for creation in DB
     * @return created mushroom stored in the database
     */
    public void createMushroom (Mushroom mushroom);
    
    /**
     * Method that updates Mushroom object in database.
     * 
     * @param mushroom
     * @return updated mushroom
     */
    public void updateMushroom (Mushroom mushroom);
    
    /**
     * Method that deletes specific mushroom from the database.
     * 
     * @param mushroom
     */
    public void removeMushroom (Mushroom mushroom);
    
    /**
     * Method that finds specific mushroom in the database.
     * 
     * @param id
     * @return mushroom found
     */
    public Mushroom findMushroom (Long id);
    
    /**
     * Method that lists all mushrooms stored in database.
     * 
     * @return list of mushrooms
     */
    public List<Mushroom> listMushrooms();
    
    /**
     * Method that lists all mushrooms based on preferred type.
     * 
     * @param type of mushroom (edible, poisonous)
     * @return list of mushrooms
     */
    public List<Mushroom> listMushroomsWithType(MushroomType type);
    
    /**
     * Method that lists all mushrooms with preferred name.
     * 
     * @param name
     * @return list of mushrooms
     */
    public List<Mushroom> listMushroomsWithName(String name);
    
    /**
     * Method that checks whether the mushroom is available during the
     * preferred month.
     * 
     * @param month
     * @return list of mushrooms 
     */
    public List<Mushroom> checkAvailability (Integer month);
    
}
